<!--新车退款详情-->
<template>
	<Modal v-model="modal" title="订单详情">
		<Form ref="formValidate" :label-width="100">
			<Form-item label="退款状态:">
					{{['待审核', '待发货', '未通过','待收货','待退款','待确认','已完成','已取消'][orderInfo.returnType]}}
			</Form-item>
			<Form-item label="订单号:">
				<span>{{orderInfo.orderNum}}</span>
			</Form-item>
			<Form-item label="日期:">
				<span>{{orderInfo.createTime | timeForm }}</span>
			</Form-item>
			<Form-item label="退款原因:">
				<span>{{orderInfo.refundReason}}</span>
			</Form-item>
			<Form-item label="应退金额:">
				<span>{{orderInfo.backMoney}}万元</span>
			</Form-item>
			<Form-item label="买家:">
				<span>{{orderInfo.userTel}}</span>
			</Form-item>
	
			<Form-item label="车辆信息">
				<Form-item  v-for="(item,index) in orderInfo.returnCarList" :key="index">
					<div class="serve-img-box">
						<!--<img :src="item.carPhoto"/>-->
						<div class="_carName">
							{{item.carName}}
						</div>
						<div class="_carMoney">
							{{item.price}}万元
						</div>
					</div>
				</Form-item>
			</Form-item>

			<Form-item label="收货地址:"  v-if="orderInfo.returnType!=0 && orderInfo.returnType!=2 && orderInfo.returnType!=7">
				<span>{{orderInfo.provinceName}}{{orderInfo.cityName}}{{orderInfo.areaName}}{{orderInfo.address}}</span>
			</Form-item>
			<Form-item label="拒绝原因:" v-if="orderInfo.returnType==2">
				<span></span>
			</Form-item>
			<div v-if="orderInfo.returnType!=0 && orderInfo.returnType!=1&& orderInfo.returnType!=2&& orderInfo.returnType!=7">
				<Form-item label="发货日期:">
					<span>{{orderInfo.deliveryDate | timeForm}}</span>
				</Form-item>
				<Form-item label="物流公司:">
					<span>{{orderInfo.logisticsCompany}}</span>
				</Form-item>
				<Form-item label="物流单号:">
					<span>{{orderInfo.singleNumber}}</span>
				</Form-item>
				<Form-item label="发货人:">
					<span>{{orderInfo.consignor}}</span>
				</Form-item>
				<Form-item label="手机:">
					<span>{{orderInfo.consignorTel}}</span>
				</Form-item>
				<Form-item label="收货备注:">
					<span>{{orderInfo.note}}</span>
				</Form-item>
			</div>
			<div  v-if="orderInfo.returnType==4 || orderInfo.returnType==5 || orderInfo.returnType==6">
				<Form-item label="收货日期:">
					<span>{{orderInfo.confirmTime | timeForm}}</span>
				</Form-item>
			</div>
			<Form-item label="支付凭证:" v-if="orderInfo.returnProof">
				<div class="serve-img-box">
					<img :src="item"  preview="0"   v-for="item in returnProof"/>
				</div>
			</Form-item>
			<Form-item label="收款日期:" v-if="orderInfo.returnType==6">
				<span>{{orderInfo.sellerTime | timeForm}}</span>
			</Form-item>
		</Form>
		
		<div slot="footer">
			<Button @click="cancel">返回</Button>
			
		</div>
	</Modal>
</template>

<script>
import {formatDate} from '../utils/time.js'
	export default {
		components: {},
		props: {},
		data() {
			return {
				modal: false,
				orderInfo: {},
				orderId: 0,
				isEdit: false,
				loadingBtn: false,
				returnProof:[]
			}
		},
		methods: {
			show(res) {
				this.$nextTick(() => {
					this.modal = true
					this.returnId = res.row.returnId
					this.$http.post('/return/new/details', {
						id: res.row.returnId
					}).then(res => {
						if (res.status == 200) {
							if (res.data.code == 200) {
								this.orderInfo = res.data.data;
								if(res.data.data.returnProof){
									this.returnProof = res.data.data.returnProof.split(',')
								}
							}

						}

					})

				})

			},

			//取消
			cancel() {
				this.modal = false
			},
			modalChange(state) {
				if (state) {

				} else {
					this.$refs.formValidate.resetFields()
				}
			}
		}
	}
</script>

<style scoped>
	.serve-img-box img{
		text-align: center;
	   width: 80px;
	   height: 60px;
	   margin-left: 5px;
	}
	._carName{
		display: inline-block;
		/*margin: 10px 0 0 10px;*/
		position: absolute
	}
	._carMoney{
		display: inline-block;
		margin: 0px 0 0 60px;
		position: absolute;
	}
	.ivu-form-item{
		margin-bottom: 1px;
	}
	._border{
		padding-bottom: 10px;
		border-bottom: 1px solid #D7DDE4;
	}
	.ivu-form-item .ivu-form-item-content .ivu-form-item {
		height: 32px!important;
	}
</style>
